<% item_count ||= current_order&.item_count %>

<%= turbo_frame_tag "cart-icon-#{item_count}", target: '_top' do %>
  <%= link_to spree.cart_path,
    class: 'relative block w-6',
    id: "cart-pane-link",
    data: { action: 'click->slideover#toggle click@window->slideover#hide' },
    onclick: 'event.preventDefault()' do %>
    <%= render 'spree/shared/icons/cart' %>
    <span class='cart-counter w-full text-[8px] font-extrabold absolute top-[10px] text-center'>
      <%= item_count if item_count&.positive? %>
    </span>
    <span class='sr-only'><%= Spree.t('storefront.cart.items_in_cart') %>, <%= Spree.t('storefront.cart.view_bag') %></span>
  <% end %>
<% end %>
